﻿@model IEnumerable<Provider.Models.Tool>

@{
    ViewBag.Title = "Home Page";
}

<div class="jumbotron">
    <h1>Home Page</h1>
    <p class="lead">
        To learn more about LTI visit
        <a href="http://developers.imsglobal.org/" title="IMS Global Learning Consortium Website">http://developers.imsglobal.org/</a>.
        The page features tutorials, and samples to help you get the most from LTI.
        If you have any questions about LTI visit
        <a href="http://developers.imsglobal.org/forum.html" title="IMS Global Learning Consortium Developer Forum">the IMS developers forum</a>.
    </p>
</div>

<div class="row">
    <div class="col-md-4">
        <h2>Create a Consumer</h2>
        <p>
            Login and create a Consumer account for your LTI consumer (LMS, Portal,
            or <a href="http://consumer.azurewebsites.net" target="_blank">
                LTI Sample Consumer
            </a>). This will also generate the LTI key and
            secret that you will need when you consume the tools.
        </p>
    </div>
    <div class="col-md-4">
        <h2>Create Some Tools</h2>
        <p>
            Create some tools to use in your consumer.
            Or use the tools that other authors created below.
        </p>
    </div>
    <div class="col-md-4">
        <h2>Consume the Tools</h2>
        <p>
            Create LTI links in your consumer web site to the tools you want to use.
            Add the LTI key and secret for your Consumer, and away you go!
        </p>
    </div>
</div>

<div class="row">
    <div class="col-md-offset-4 col-md-4">
        @if (Request.IsAuthenticated)
        {
            if (!Model.Any())
            {
                <h3>Tools</h3>
                <p>There are no tools yet.</p>
            }
            else
            {
                <table class="table">
                    <tr>
                        <th>Tool</th>
                    </tr>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>
                                @Html.ActionLink(item.Name, "Details", "Tool", new { id = item.ToolId }, new { title = item.Description })
                            </td>
                        </tr>
                    }
                </table>
            }
        }
        else
        {
            <h3>Tools</h3>
            <p>Please register or log in to see the list of available tools and content.</p>
        }
    </div>
</div>
